package com.yunzhi.www.smarthome;

import android.content.Intent;
import com.yunzhi.www.fromlibrary.base.*;
import com.yunzhi.www.fromlibrary.core.*;
import android.os.Bundle;
import android.os.Message;
import android.util.Log;

import java.util.Timer;
import android.os.Handler;

import java.util.TimerTask;
import java.util.logging.LogRecord;

public class MainActivity extends BaseActivity {

    private static final String TAG="MainActivity";
    Timer timer=new Timer();
    private Handler handler=new Handler() {
        @Override
        public void handleMessage(Message msg){
            super.handleMessage(msg);
            if(msg.what!=2){
                Log.e(TAG,"bb");
            } else if(msg.what==2){
                Log.e(TAG,"ccccccccccc");
                openPage("mainpage",null,CoreAnim.fade,false);
                timer.cancel();
            }
        }
    };
    private TimerTask timerTask;
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        Log.i("TAG", "onCreate: ");
        openPage("startpage", null, CoreAnim.none);
        timerTask=new TimerTask() {
            int cc=0;
            public void run() {
                Message message=Message.obtain();
                cc++;
                message.what=cc;
                handler.sendMessage(message);
            }
        };
        timer.schedule(timerTask,0,3000);

    }

    @Override
    protected void onActivityResult(int requestCode, int resultCode, Intent data) {
        super.onActivityResult(requestCode, resultCode, data);
    }
}

